package com.beiqian.controller;

import com.beiqian.service.IOllamaChatModelService;
import dev.langchain4j.model.chat.ChatLanguageModel;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: beiqian
 * @Date: 2024-08-09 20:21
 * @Description:
 */

@Api(value = "/chat", tags = {":"})
@RestController
public class chatController {



    @Resource
    private IOllamaChatModelService ollamaChatModelService;
    /**
     * 交流
     * @param message
     * @return
     */


    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "message", value = "", required = true)
    })
        @ApiOperation(value = "交流", notes = "交流", httpMethod = "GET")
        @GetMapping("/chat")
        public String chat(@RequestParam("message") String message){

            return ollamaChatModelService.chat(message);

        }
}
